import React, { useEffect, useState } from "react";
import styles from './index.module.less'

export default function List(props: any) {
    const [timer, setTimer] = useState(10);
    const [flag, setFlag] = useState(false);
    const interval = setInterval(() => {
        if (timer != 0) {
            setTimer(timer-1);
        } else {
            setFlag(true)
        }
        clearInterval(interval);
    }, 1000);
    return (
        <div className={styles.card}>
            <div>
                <div>杭州市通用5元券</div>
                <div>待实现</div>
            </div>
            <button className={styles.button}>{!flag ? timer : 1}</button>
        </div>
    );
}